package com.practicaljava.lesson24;

import java.lang.annotation.*;

public class DBParamProcessor {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Class c = null;
		try {
			c = Class.forName("com.practicaljava.lesson24.MyDBWorker");
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		}
		Annotation[] annotations = c.getAnnotations();
		for(Annotation a: annotations){
			if (a instanceof DBParams){
				System.out.println("Database: "+((DBParams) a).dbName());
				System.out.println("User: "+((DBParams) a).uid());
				System.out.println("Password: "+((DBParams) a).password());
			}
		}

	}

}
